local rolely_zhankai = fk.CreateSkill {
    name = "rolely_zhankai",
    anim_type = "offensive",
    tags = { Skill.Compulsory }
}
Fk:loadTranslationTable {
    ["rolely_zhankai"] = "战铠",
    [":rolely_zhankai"] = "锁定技，当你受到其他角色造成的伤害时，其随机弃置一张牌，若不是其本回合第一次受到伤害，其失去一点体力；若此伤害大于2点，减至两点，你摸两张牌。",

    ["$rolely_zhankai1"] = "兴战之铠，触之必伤！",
    ["$rolely_zhankai2"] = "厌伤之胄，睚眦必报！",

}
rolely_zhankai:addEffect(fk.DamageInflicted, {
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(rolely_zhankai.name) and data.from and data.from ~= player and
            not data.from.dead
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        if data.damage > 2 then
            data:changeDamage(2 - data.damage)
            player:drawCards(2, rolely_zhankai.name)
        end
        if #data.from:getCardIds("he") > 0 then
            local card = table.random(data.from:getCardIds("he"))
            room:throwCard({ card }, rolely_zhankai.name, data.from, player)
        end
        if player:getMark("rolely_zhankai-turn") == 0 then
            room:setPlayerMark(player, "rolely_zhankai-turn", 1)
        else
            room:loseHp(data.from, 1, rolely_zhankai.name)
        end
    end
})
return rolely_zhankai
